package com.qhgrain.app.util;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.paas.base.modules.utils.lang.StringUtil;

public class ControllerUtil {

	public static void getSetParameters(HttpServletRequest request){
		Map<String,String[]> map = request.getParameterMap();
		for(Map.Entry<String, String[]> m : map.entrySet()){
			if(m.getValue() != null){
				request.setAttribute(m.getKey(), m.getValue()[0]);
			}
			
		}
	}
	public static void getParameterForMap(HttpServletRequest request , Map<String,Object> map){
		Map<String,String[]> paramMap = request.getParameterMap();
		for(Map.Entry<String, String[]> m : paramMap.entrySet()){
			if(m.getValue() != null && StringUtil.isNotBlank(m.getValue()[0])){
				map.put(m.getKey(), m.getValue()[0].trim());
			}
			
		}
	}
}
